using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Xml;
using System.Xml.Serialization;
using Domain.DataManagenent;
using Domain.Entities;
using Services;

namespace Logic.UserManagement
{
    public class UserImporter:IImporter <User>
    {
        public List<User> Import(Stream stream)
        {
            var serialiser = new XmlSerializer(typeof (List<User>));
            var xmlReader = new StreamReader(stream);
            var newList = (List<User>) serialiser.Deserialize(stream);
            xmlReader.Close();
            stream.Close();
            return newList;
        }
    }
}